home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / np < prev    next >
Encoding:
Text File  |  1994-03-09  |  430 b   |  23 lines

  1. #!/usr/bin/perl -s
  2.  
  3. # this perl script makes an include file for Forth
  4.  
  5. # usage:
  6. #    np /usr/lib/libc.sa >libc.4
  7.  
  8. print "BASE @ HEX\n";
  9.  
  10. for ($i = 0; $i <= $#ARGV; $i++)    {
  11.     open(symbols, "nm $ARGV[$i] |");
  12.  
  13.     while(<symbols>)    {
  14.         if (/^([0-9a-f]+) A __((GOT)|(PLT))__*(.{1,31})$/o)    {
  15.             ($value, $keyword, $_) = ($1,$2,$5);
  16.             if (!(/\$/o || /^[0-9]/o || /__/o))            {
  17.                 print "$value $keyword $_\n";
  18.             }
  19.         }
  20.     }
  21.  
  22. }
  23. print "BASE !\n";